<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../plugins/layui/css/layui.css" />
		<link href="../../kitAdmin/css/app.css" rel="stylesheet" type="text/css" />

		<!--<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />-->
		<link rel="stylesheet" type="text/css" href="../../plugins/select2/dist/css/select2.min.css" />
		<style type="text/css">
			body {
				/*padding: 20px;*/
			}
			
			.kit-table {
				height: 100%;
				/*margin: 15px;*/
				margin: 1px;
				padding: 20px;
			}
			
			.kit-footer-right {
				/*float: right!important;*/
				margin-right: 20px;
			}
			/*.layui-form-label{
				max-width: none !important; 
			}*/
		</style>
	</head>

	<body>
		<div class="kit-table">
			<div style='margin-top:10px'>
				<form class='layui-form' action='' lay-filter='form-edit'>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>型号类型id </label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$modelNumberTypeUid' name='modelNumberTypeUid' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>材料名称</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' data-link="{:name}" id='$name' name='name' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>型号</label>
							<div class='layui-input-inline'>
								<select class="" data-link='{:modelNumber}' placeholder='' id='modelNumber' name='modelNumber'></select>
								<!--<input type='text' data-link='{:modelNumber}' placeholder='' id='$modelNumber' name='modelNumber' class='layui-input'>-->
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>规格</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$specification' name='specification' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>单位</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$unit' name='unit' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>生产零件名称</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$productionPartName' name='productionPartName' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>所属部件名称</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$theComponentName' name='theComponentName' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>生产单位</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$productionUnit' name='productionUnit' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>产品配套数量</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$numberAncillaryProducts' name='numberAncillaryProducts' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>合计 配套数量 乘小计</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$total' name='total' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>定额</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$quantity' name='quantity' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>单价</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$unitPrice' name='unitPrice' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>小计 定额乘单价</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$subtotal' name='subtotal' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>价格支撑材料编号</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$priceSupportNumber' name='priceSupportNumber' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>定额支撑材料编号</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$quotaSupportNumber' name='quotaSupportNumber' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>备注</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$remark' name='remark' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>1删除</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$isDelete' name='isDelete' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>版本号</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$versions' name='versions' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>版本uid</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$versionsUid' name='versionsUid' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>taskNumber</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$taskNumber' name='taskNumber' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>创建时间</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' data-link="{:endTime}" id='$createDate' name='createDate' class='layui-input'>
							</div>
						</div>
						<div class='layui-inline'>
							<label class='layui-form-label'>yuliu1</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$yuliu1' name='yuliu1' class='layui-input'>
							</div>
						</div>
					</div>
					<div class='layui-form-item'>
						<div class='layui-inline'>
							<label class='layui-form-label'>yuliu2</label>
							<div class='layui-input-inline'>
								<input type='text' placeholder='' id='$yuliu2' name='yuliu2' class='layui-input'>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
		<script src="../../common/js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/jsviews/jsviews.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/laydate5.0.9/laydate.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/select2/dist/js/select2.min.js" type="text/javascript" charset="utf-8"></script>
		<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>-->

		<script type="text/javascript">
			//时间选择器
			laydate.render({
				elem: '#startTime',
				type: 'datetime'
			});
			//endTime
			laydate.render({
				elem: '#endTime',
				type: 'datetime'
			});

			function something() {
				return "hello word";
			}
			var callback_save = function() {
				return $('.layui-form').serialize();
			}

			var myTemplate = $.templates("#peopleTmpl");
			var people = [{
					ID: "Ad0",
					name: "JoshWang"
				},
				{
					ID: "Ro0",
					name: "WangSheng",
					nickname: "Jack"
				}
			];
			var per = {
				'name': '陆小凤',
				'endTime': "2017-12-22 22:15:5",
				'modelNumber': '13',
				people: people
			};

			$(document).ready(function() {
				var arr = [];
				for(var i = 0; i < 20; i++) {
					var obj = {};
					obj.text = 1 + i + '选项';
					obj.id = 1 + i;
					arr.push(obj);
				}
				$('#modelNumber').select2({
					data: arr
				});
				$.link(true, ".kit-table", per);
				//select2通过模板绑定值以后不会自动刷新，需手动刷新一下；
				$('select').select2().change();
				//				alert($('#modelNumber').val());
			});
			//			myTemplate.link(".kit-table", per);
		</script>
	</body>

</html>